import 'package:flutter/material.dart';
import 'package:flutter_demo/common_widget/IndexPage.dart';
import 'package:flutter_demo/pages/demo_page/top_background.dart';
import 'package:flutter_demo/utils/IconFont.dart';
import 'package:flutter_demo/utils/navigator_util.dart';
import 'package:flutter_demo/widget/app_upgrade.dart';
import 'package:flutter_demo/widget/rote_float_button.dart';

class DemoPage extends StatefulWidget {
  DemoPage({Key key}) : super(key: key);

  @override
  _DemoPageState createState() => _DemoPageState();
}

class _DemoPageState extends State<DemoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('demo 页面'),
      ),
      body: Stack(
        children: [
          Positioned(
              child: Column(
            children: [
              TextButton(
                  child: Text('升级'),
                  onPressed: () {
                    showAppUpgradeDialog(context: context, isBackDismiss: true);
                  }),
              TextButton(
                  child: Text('canvas头部背景'),
                  onPressed: () {
                    NavigatorUtil.pushPage(
                        context: context, targetPage: TopBackground());
                  }),
              Icon(IconFonts.IconWeChat),
              ElevatedButton(
                  onPressed: () {
                    NavigatorUtil.pushPage(
                        context: context, targetPage: IndexPageDemo());
                  },
                  child: Text('例子页面'))
            ],
          )),
          Positioned(
            right: 33,
            bottom: 33,
            //悬浮按钮
            child: RoteFloatingButton(
              //菜单图标组
              iconList: [
                Icon(Icons.add),
                Icon(Icons.message),
                Icon(Icons.aspect_ratio),
              ],
              //点击事件回调
              clickCallback: (int index) {},
            ),
          ),
        ],
      ),
    );
  }
}
